@extends('home.layout.layout')

@section('content')

<article>
@include('home.layout.aside')

    <main class="r_box">
        @if( !empty($images) )
        <div id="slidr-img" style="display: inline-block">
            @foreach($images as $image)
            <img data-slidr="{{ $loop->iteration }}" src="{{ $image['img_url'] }}" onclick='location.href = "{{ $image['url'] }}"' />
            @endforeach

        </div>
        @endif
        
        @foreach($articles as $article)
        <li>
            <i><a href="{{ url('article/detail/'.$article['id']) }}"><img src="{{ $article['img_url'] }}"></a></i>
            <h3><a href="{{ url('article/detail/'.$article['id']) }}">{{$article['title']}}</a></h3>
            <p>{{$article['desc']}}</p>
        </li>
        @endforeach

        <!-- 分页 -->
        <div style="margin-left:45%">{{ $articles->links() }}</div>


    </main>
</article>

<script>
    slidr.create('slidr-img').start();
</script>

@endsection
